import Vue from 'vue'
import Router from 'vue-router'
import userList from '../components/userMange/userList'
import userIndex from '../components/userMange/Index.vue'
import mainText from '../components/home/mainText'
import mainTextUser from '../components/home/mainTextUser.vue'
import orderSee from '../components/orderMange/orderSee'
import orderSeeUser from '../components/orderMange/orderSeeUser.vue'
import orderCount from '../components/orderMange/orderCount.vue'
import configManager from '../components/configManager/config'
import transfer from '../components/userMange/transfer'
import requireList from '../components/tixian/requireList'
import tixianGroup from '../components/tixian/businessGroup.vue'
import tixianChannle from '../components/tixian/channle.vue'
import requireListUser from '../components/tixian/requireListUser.vue'
import tixian from '../components/tixian/tixian.vue'
import tixianBusiness from '../components/tixian/business.vue'
import daifu from '../components/tixian/daifu.vue'

import addMerchant from '../components/merchantMange/addMerchant'
import businessGroup from '../components/merchantMange/businessGroup'
import addBusiness from '../components/merchantMange/addBusiness'
import messageList from '../components/message/messageList.vue'

import realNameList from '../components/realName/realNameList.vue'

import shWeiXin from '../components/businessReport/shWeiXin.vue'
import addReport from '../components/businessReport/addReport.vue'
import classify from '../components/businessReport/classify.vue'
import reportGrouop from '../components/businessReport/businessGroup.vue'
import reportChannle from '../components/businessReport/channle.vue'

import bankList from '../components/bankRequire/bankRequireList.vue'

import holiday from '../components/holiday/holidayList.vue'

import permisson from '../components/permission/Index.vue'
import menuList from '../components/menuContro/Index.vue'
import roleMange from '../components/roleMange/roleMange.vue'

import userInfo from '../components/user/userInfo'
import realName from '../components/user/realName'
import bankname from '../components/user/bankcard'
import revisePwd from '../components/user/revisePwd'

import checkEmail from '../components/system/checkEmail'
import history from '../components/system/history'

import weiCode from '../components/dealCount/weiCode.vue'
import zhiCode from '../components/dealCount/zhiCode.vue'

import bankChannle from '../components/bankMange/bankChannle.vue'
import bankGroup from '../components/bankMange/bankGroup.vue'
import bankMangeList from '../components/bankMange/bankList.vue'

import reourceList from '../components/resourceMange/reourceList.vue'
import count from '../components/dealCount/count.vue'

import alipaycode from '../components/phonecode'

import alipay from '../components/dealCount/alipay.vue'

import ercode from '../components/user/ercode.vue'
import accountCount from '../components/dealCount/accountCount.vue'

import errorOrder from '../components/dealCount/errorOrder.vue'
import businessErcode from '../components/user/businessGroup.vue'

import upGroup from '../components/dealCount/upload/group.vue'
import upBusiness from '../components/dealCount/upload/business.vue'
import uploadList from '../components/dealCount/upload/uploadList.vue'
import businessCount from '../components/orderMange/businessCount.vue'
import tixianCount from '../components/dealCount/tixianCount.vue'
import uploadList2 from '../components/dealCount/upload/uploadList2.vue'
import group2 from '../components/dealCount/upload/group2.vue'
import business2 from '../components/dealCount/upload/business2.vue'
import uploadList3 from '../components/dealCount/upload/uploadList3.vue'
import group3 from '../components/dealCount/upload/group3.vue'
import business3 from '../components/dealCount/upload/business3.vue'

import nameFirst from '../components/userMange/lock/nameFirst.vue'
import nameSecond from '../components/userMange/lock/nameSecond.vue'

import dfBusinessList from '../components/dfBusinessManager/business'

import dfOrder from '../components/dfBusinessManager/order'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: load('home/login')
    },
    {
      path: '/login',
      name: 'login2',
      component: load('home/login')
    },
    {
      path: '/transfer',
      name: 'transfer',
      component: transfer
    },
    {
      path: '/forget',
      name: 'forget',
      component: load('home/forget')
    },
    {
      path: '/main',
      name: 'main',
      component: load('home/index'),
      children: [{
        path: '/userMange/userList',
        name: '用户列表',
        component: userList
      },
        {
          path: '/',
          name: '用户主页c',
          component: mainTextUser
        },
        {
          path: '/userMange/userIndex',
          name: 'userIndex',
          component: userIndex
        },

        {
          path: '/home/mainText',
          name: '后台主页',
          component: mainText
        },
        {
          path: '/home/mainTextUser',
          name: '用户主页',
          component: mainTextUser
        },
        {
          path: '/orderMange/orderSee',
          name: '后台订单查看',
          component: orderSee
        },
        {
          path:'/daifu/businessList',
          name:'代付商户列表',
          component:dfBusinessList
        },
        {
          path: '/orderMange/orderSeeUser',
          name: '用户订单查看',
          component: orderSeeUser
        },
        {
          path: '/order/count',
          name: '订单统计',
          component: orderCount
        },
        {
          path: '/tixian/requireList',
          name: '后台提现列表',
          component: requireList
        },
        {
          path: '/merchantMange/addMerchant',
          name: '商户/添加通道',
          component: addMerchant
        },
        {
          path: '/merchantMange/businessGroup',
          name: '商户/添加商户组',
          component: businessGroup
        },
        {
          path: '/merchantMange/addBusiness',
          name: '添加商户',
          component: addBusiness
        },
        {
          path: '/message/messageList',
          name: '消息列表',
          component: messageList
        },
        {
          path: '/businessReport/shWeiXin',
          name: '商户报件列表',
          component: shWeiXin
        },
        {
          path: '/realName/realNameList',
          name: '实名管理列表',
          component: realNameList
        },
        {
          path: '/report/addReport',
          name: '添加通道',
          component: addReport
        },
        {
          path: '/bank/bankList',
          name: '银行卡列表',
          component: bankList
        },
        {
          path: '/report/classify',
          name: '商户报件分类',
          component: classify
        },
        {
          path: '/holiday/holiday',
          name: '节假日列表',
          component: holiday
        },
        {

          path: '/tixian/user',
          name: '用户提现列表',
          component: requireListUser
        },
        {
          path: '/tixian/group',
          name: '用户提现商户组',
          component: tixianGroup
        },
        {
          path: '/tixian/channle',
          name: '用户提现通道',
          component: tixianChannle
        },
        {
          path: '/tixian/tixian',
          name: '用户提现',
          component: tixian
        },
        {
          path: '/tixian/business',
          name: '商户提现',
          component: tixianBusiness
        },
        {
          path: '/report/grouop',
          name: '商户报件组列表',
          component: reportGrouop
        },
        {
          path: '/report/channle',
          name: '商户报件通道列表',
          component: reportChannle
        },
        {
          path: '/permisson/permisson',
          name: '权限列表',
          component: permisson
        },
        {
          path: '/menuContro/menuList',
          name: '菜单管理',
          component: menuList
        },
        {
          path: '/roleMange/roleMange',
          name: '角色管理',
          component: roleMange

        },
        {
          path: '/user/userInfo',
          name: '用户个人信息',
          component: userInfo
        },
        {
          path: '/user/realName',
          name: '实名认证',
          component: realName
        },
        {
          path: '/user/bank',
          name: '银行卡认证',
          component: bankname
        },
        {
          path: '/user/revisePwd',
          name: '修改密码',
          component: revisePwd
        },

        {
          path: '/system/history',
          name: '用户登录记录',
          component: history
        },
        {
          path: '/system/checkEmail',
          name: '绑定邮箱',
          component: checkEmail
        },
        {
          path: '/dealCount/weiCode',
          name: '微信扫码统计列表',
          component: weiCode
        },
        {
          path: '/dealCount/zhiCode',
          name: '支付宝扫码统计列表',
          component: zhiCode
        },
        {
          path: '/bank/channle',
          name: '银行卡管理通道列表',
          component: bankChannle
        },
        {
          path: '/bank/group',
          name: '银行卡管理商户组列表',
          component: bankGroup
        },
        {
          path: '/bank/mangeList',
          name: '银行卡管理列表',
          component: bankMangeList
        },
        {
          path: '/resource/List',
          name: '资源管理列表',
          component: reourceList
        },
        {
          path: '/count/List',
          name: '统计列表',
          component: count
        },
        {
          path: '/daifu/List',
          name: '代付列表',
          component: daifu
        },
        {
          path: '/phone/code',
          name: '手机验证码',
          component: alipaycode
        },
        {
          path: '/query/alipay',
          name: '支付宝查询',
          component: alipay
        },
        {
          path: '/user/ercode2',
          name: '用户查看二维码',
          component: ercode
        },
        {
          path: '/user/ercode',
          name: '用户查看二维码的商户组列表',
          component: businessErcode
        },
        {
          path: '/alipay/count',
          name: '支付宝订单统计',
          component: accountCount
        },
        {
          path: '/order/error',
          name: '错误订单统计',
          component: errorOrder
        },
        {
          path: '/upload/group',
          name: '上传二维码的商户组列表',
          component: upGroup
        },
        {
          path: '/upload/business',
          name: '上传二维码的商户列表',
          component: upBusiness
        },
        {
          path: '/upload/list',
          name: '上传二维码的列表',
          component: uploadList
        },
        {
          path: '/business/count',
          name: '商户统计',
          component: businessCount
        },
        {
          path: '/tixian/count',
          name: '商户统计',
          component: tixianCount
        },
        {
          path: '/upload/group2',
          name: '上传二维码的商户组列表',
          component: group2
        },
        {
          path: '/upload/business2',
          name: '上传二维码的商户列表',
          component: business2
        },
        {
          path: '/upload/list2',
          name: '上传二维码列表2',
          component: uploadList2
        },
        {
          path: '/upload/group3',
          name: '上传二维码的商户组列表3',
          component: group3
        },
        {
          path: '/upload/business3',
          name: '上传二维码的商户列表3',
          component: business3
        },
        {
          path: '/upload/list3',
          name: '上传二维码列表3',
          component: uploadList3
        },
        {
          path: '/user/lock',
          name: '冻结',
          component: nameFirst
        },
        {
          path: '/user/operat',
          name: '操作记录',
          component: nameSecond
        },
        {
          path:'/system/config',
          name:'平台配置',
          component:configManager
        },
        {
          path:'/daifu/order',
          name:'代付订单列表',
          component:dfOrder
        }
      ]
    }
  ]
})

/**
 * 导入页面组件
 * @param component
 * @returns {function()}
 */
function load (component) {
  // '@' is aliased to src
  return () => import(`@/components/${component}.vue`)
}
